<link rel="stylesheet" href="<%= basePath %>/lib/sui.min.css">
<link rel="stylesheet" href="<%= basePath %>/lib/sui-append.min.css">
<link rel="stylesheet" href="<%= basePath %>/public/iconfont/iconfont.css">
<link rel="stylesheet" href="<%= basePath %>/public/css/style.css">
<link rel="stylesheet" href="<%= basePath %>/modules/teacher/css/style.css">

<script type="application/javascript" src="<%= basePath %>/lib/jquery.min.js"></script>
<script type="application/javascript" src="<%= basePath %>/lib/sui.min.js"></script>
<script type="application/javascript" src="<%= basePath %>/public/js/util.js"></script>
<script type="application/javascript" src="<%= basePath %>/modules/teacher/js/query.js"></script>
<script type="application/javascript" src="<%= basePath%>/modules/teacher/js/absence_apply.js"></script>

<%
var AbsenceApplyStatusInfo = {
    0: {
        className: 'unchecked',
        text: '未审核'
    },
    1: {
        className: 'checked',
        text: '审核通过'
    },
    2: {
        className: 'checked',
        text: '审核未通过'
    }
}
%>

<div class="body_scroll">
    <div class="frame-content striplist">
        <% if ( absenceApplies.today.length == 0 ) {
        %>
        <div class="no-content">
            <div class="iconfont">&#xe621;</div>
            <div class="warning">暂无内容</div>
        </div>
        <%
        } %>
        <%absenceApplies.today.forEach(function(apply){%>
        <div data-toggle="modal" data-target='#stripChecking[data-id="<%=apply.id%>"]' data-keyboard="false" class="chip <%=AbsenceApplyStatusInfo[apply.status].className%>">
                <span class="chip-content">
                    <%=apply.student.name%>于<%=lib.util.formatTime(apply.time)%>递交了一份请假条
                </span>
                <span class="status">
                    <%=AbsenceApplyStatusInfo[apply.status].text%>
                </span>
        </div>
        <%});%>
    </div>

    <%absenceApplies.today.forEach(function(apply){%>
    <div id="stripChecking" data-id="<%=apply.id%>" tabindex="-1" role="dialog" data-hasfoot="false" class="sui-modal hide fade strip">
        <div class="modal-dialog">
            <div class="modal-content">
                <button type="button" data-dismiss="modal" aria-hidden="true" class="sui-close">×</button>
                <div class="modal-body">
                    <p style="text-align: center;font-size: 16px">请假条</p>

                    <p>尊敬的老师</p>
                    <!-- <%=apply.id%> -->
                    <p>&nbsp;&nbsp;&nbsp;&nbsp;本人因<%=apply.comment%>原因请假,需要
                        <%=lib.util.formatDate(apply.start)%>
                        <%=lib.util.formatTime(apply.start)%>
                        至
                        <%=lib.util.formatDate(apply.end)%>
                        <%=lib.util.formatTime(apply.end)%>
                        请假,恳请批准.</p>

                    <p style="text-align:right">请假人:<%=apply.student.name%></p>

                    <p style="text-align:right">请假时间:
                        <%=lib.util.formatDate(apply.time)%>
                        <%=lib.util.formatTime(apply.time)%>
                    </p>

                </div>
                <div class="modal-footer">
                <span class="status">
                    <%=AbsenceApplyStatusInfo[apply.status].text%>
                </span>

                    <% if ( apply.status == 0 ) { %>
                    <button type="button" data-ok="modal" class="btn-agree sui-btn btn-primary btn-large">批准</button>
                    <% } %>
                </div>
            </div>
        </div>
    </div>
    <%});%>
</div>